<template>
  <div>hooks文件中的变量：{{name1}}</div>
  <div>hooks文件中的变量：{{name2}}</div>
  <div>当前文件中的变量：{{age}}</div>
  <button @click="addAge">加</button>
</template>

<script setup>
import { reactive, ref, onMounted } from "vue";
import { name1 } from "@/hooks/useMousePosition";
import myhooks from "@/hooks/myhooks";

let age = ref(18);

let addAge = () => {
  age.value++;
};
let { name2 } = myhooks({ age });
</script>
<style scoped lang ='less'>
</style>